//
//  PaymentViewTableViewHeader.swift
//  SmartHousekeeper
//
//  Created by 张磊 on 2020/2/22.
//  Copyright © 2020 LS. All rights reserved.
//

import UIKit

class PaymentViewTableViewHeader: UIView {
    
    lazy var addressL : UILabel = {
        let value = UILabel(textColor: RGBColor(r: 99, g: 99, b: 99, a: 1), textFont: UIFont.systemFont(ofSize: Adapter(13)))
        value.text = "绑定房屋地址:株洲市建宁花园小区3栋1002室"
        value.numberOfLines = 2
        return value
    }()
    
    
    lazy var moneyL: UILabel = {
        let value = UILabel(textColor: .black, textFont: UIFont.boldSystemFont(ofSize: Adapter(35)))
        value.text = "880.00"
        return value
    }()
    
    lazy var orderNoL: UILabel = {
        let value = UILabel(textColor: RGBColor(r: 116, g: 116, b: 116, a: 1), textFont: UIFont.systemFont(ofSize: Adapter(15)))
        value.text = "订单号:3928313792187391"
        return value
    }()
    lazy var payTypeL: UILabel = {
        let value = UILabel(textColor: RGBColor(r: 116, g: 116, b: 116, a: 1), textFont: UIFont.systemFont(ofSize: Adapter(15)))
        value.text = "请选择支付方式:"
        return value
    }()
    
    
    
    lazy var switchV : UISwitch = {
        let value = UISwitch()
        //设置开启状态显示的颜色
        value.onTintColor = RGBColor(r: 62, g: 134, b: 230, a: 1)
        //设置关闭状态的颜色
        value.tintColor = .black
        //滑块上小圆点的颜色
        value.thumbTintColor = .white
        value.isOn = true
        
        return value
    }()
    
    
    required init?(coder: NSCoder) {
        super.init(coder: coder)
    }
    override init(frame: CGRect) {
        super .init(frame: frame)
        setHeader()
    }
    func setHeader() {
        self.addSubview(addressL)
        addressL.snp.makeConstraints { (make) in
            make.left.equalTo(self).offset(Adapter(30))
            make.right.equalTo(self).offset(-Adapter(30))
            make.top.equalToSuperview().offset(Adapter(5))
            make.height.equalTo(Adapter(35))
        }
        
        let line = UIView()
        line.backgroundColor = RGBColor(r: 114, g: 114, b: 114, a: 1)
        self.addSubview(line)
        line.snp.makeConstraints { (make) in
            make.left.equalTo(self).offset(Adapter(15))
            make.right.equalTo(self).offset(-Adapter(15))
            make.top.equalTo(addressL.snp.bottom).offset(Adapter(15))
            make.height.equalTo(Adapter(0.8))
        }
        
        
        
        self.addSubview(moneyL)
        moneyL.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalTo(line.snp.bottom).offset(Adapter(40))
            make.height.equalTo( Adapter(35));
        }
        
        self.addSubview(orderNoL)
        orderNoL.snp.makeConstraints { (make) in
            make.centerX.equalToSuperview()
            make.top.equalTo(moneyL.snp.bottom).offset(Adapter(6))
            make.height.equalTo( Adapter(20));
        }
        
        self.addSubview(payTypeL)
        payTypeL.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(Adapter(30))
            make.top.equalTo(orderNoL.snp.bottom).offset(Adapter(40))
            make.height.equalTo( Adapter(20));
        }
        
        
        
    }
    
    
}
